package com.hansming.bss.modules.sfc.service;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.hansming.bss.common.service.CrudService;
import com.hansming.bss.modules.sfc.dao.LineBranchDao;
import com.hansming.bss.modules.sfc.entity.LineBranch;

/**
 * 线路分支（现在为车型）Service
 * @author Hansming
 * @version 2017-09-119
 */
@Service
@Transactional(readOnly = true)
public class LineBranchService extends CrudService<LineBranchDao,LineBranch> {
	
	@Autowired
	private LineBranchDao linebranchDao;
	
	//更具线路id查找所有的线路分支
		public List<LineBranch> selectByLineid(String lineid){
			return linebranchDao.selectByLineid(lineid);
		};
		
	//添加分支
	@Transactional(readOnly = false)
	public void savelinebranch(String id,String branchname,String lineid){
		linebranchDao.savelinebranch(id, branchname, lineid);
	}
	
	//删除分支
	@Transactional(readOnly = false)
	public void deletebyid(String id){
		linebranchDao.deletebyid(id);
	}
	
	//=======主要小程序用service===========
	//选择线路车型中的一个车型
	public LineBranch selectByLineidLimitOne(String lineid){
		return linebranchDao.selectByLineidLimitOne(lineid);
	}
	
	
}
